package com.zkingsoft.dao;

import java.util.List;

import com.zkingsoft.entity.Entity;
import com.zkingsoft.entity.User;

public class UserDaoImpl implements IUserDao {

	@Override
	public Entity findByNameAndPwd(String userName, String pwd) {
		User user2 = null;
		//try {
		//Connection conn = getConnect();
		//if(rs.next()) {
		//if(rs.getString("userName").equals(userName) && rs.getString("userPwd").equals(userPwd)) {
		//   user2 = new User();
		//   user2.setUserName(rs.getString("userName"));
		//	 user2.setUserPwd(rs.getString("userPwd"));		      
		//}

		//
		
		//} cathc (Exception ex) {
		//    ex.printTraceStack();
		//}
		// return user2;
		if(userName.equals("chenlong") && pwd.equals("123321")) {
			User user = new User();
			user.setUserName("chenlong");
			user.setUserPwd("123321");
			return user;
		}
		return null;
	}

	@Override
	public void add(Entity t) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(Entity t) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Entity findByPrimaryKey(Integer pk) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void delete(Integer pk) {
		
	}

	@Override
	public List findByAll() {
		return null;
	}


}
